

//
//  SHAboutAppViewController.m
//  JiFengDaRen
//
//  Created by SH_iOS on 2017/5/31.
//  Copyright © 2017年 SH_iOS. All rights reserved.
//

#import "SHAboutAppViewController.h"


@interface SHAboutAppViewController ()
@property (strong, nonatomic)  UIImageView *icon;
@property (strong, nonatomic)  UILabel  *versionLabel;


@end

@implementation SHAboutAppViewController


- (void)viewDidLoad {
    [super viewDidLoad];
    [self configUI];
}
- (void)configUI{
    
    self.view.backgroundColor = [UIColor whiteColor];
    self.title = @"关于我们";
    self.icon = [[UIImageView alloc]init];
    self.icon.image = [UIImage imageNamed:@"my_about"];
    [self.view addSubview:self.icon];
    [self.icon mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.mas_equalTo(self.view).offset(__I6Height(50));
        make.centerX.equalTo(self.view.mas_centerX);
    }];

    self.versionLabel = [[UILabel alloc]init];
    self.versionLabel.font = KSystemFont(__I6Width(13));
    self.versionLabel.textColor = [UIColor colorWithHexString:@"#BFC0C5"];
    self.versionLabel.textAlignment = NSTextAlignmentCenter;
    NSString *version = [[[NSBundle mainBundle] infoDictionary] objectForKey:@"CFBundleShortVersionString"];
    self.versionLabel.text = [NSString stringWithFormat:@"V%@",version];
    
    [self.view addSubview:self.versionLabel];
    [self.versionLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.mas_equalTo(self.icon.mas_bottom).with.offset(__I6Height(10));
        make.centerX.mas_equalTo(self.view);
    }];
    
    
    UILabel * titleLable = [UILabel new];
    titleLable.text = @"领创壹号";
    titleLable.font = KBoldFont(18);
    titleLable.textColor = [UIColor colorWithHexString:@"#333333"];
    titleLable.textAlignment = NSTextAlignmentCenter;
    [self.view addSubview:titleLable];
    
    [titleLable mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.versionLabel.mas_bottom).offset(__I6Height(18));
        make.centerX.equalTo(self.view);
    }];
    
    NSMutableAttributedString *attributedStr = [[NSMutableAttributedString alloc]initWithString:@"是由全国领先的支付公司专业技术人员，展开核心的技术开发。 2017年开发的2.0版智能还款,全国落地商户, 完美账单, 更是在行业内外获得一致好评。 相比初期开发的1.0版无积分, 不落地, 2.0版更是行业良性发展的一大创新, 预计近期我们将推出3.0版, 再造行业精品之作!\n我们的宗旨是: 全心全意为持卡人服务。"];

    NSMutableParagraphStyle *paragraphStyle = [[NSMutableParagraphStyle alloc] init];
    [paragraphStyle setLineSpacing:8];
    paragraphStyle.firstLineHeadIndent = 20;
    [attributedStr addAttribute:NSParagraphStyleAttributeName value:paragraphStyle range:NSMakeRange(0, [attributedStr length])];

    UILabel * explans = [UILabel new];
    explans.numberOfLines = 0;
    explans.textColor = [UIColor colorWithHexString:@"#666666"];
    explans.font = KBoldFont(12);
    explans.attributedText = attributedStr;
    [explans sizeToFit];
    [self.view addSubview:explans];
    
    [explans mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(titleLable.mas_bottom).offset(55);
        make.left.equalTo(self.view).offset(__I6Width(15));
        make.right.equalTo(self.view).offset(-__I6Width(15));
    }];
    
    
//    UILabel * webLabel = [[UILabel alloc] init];
//    webLabel.text = @"2018 www.021nhwl.com";
//    webLabel.textColor = [UIColor colorWithHexString:@"#666666"];
//    webLabel.font = KSHSystemFont(12);
//    [self.view addSubview:webLabel];
//
//    [webLabel mas_makeConstraints:^(MASConstraintMaker *make) {
//        make.bottom.equalTo(self.view).offset(-__I6Height(15));
//        make.centerX.equalTo(self.view);
//    }];
//
    
    NSMutableAttributedString *phoneStr = [[NSMutableAttributedString alloc] initWithString:@"官方客服电话:183-1030-8601"];

    [phoneStr addAttribute:NSForegroundColorAttributeName
                        value:[UIColor colorWithHexString:@"#0E8AEE"]
                        range:NSMakeRange(phoneStr.length-13, 13)];

    UILabel * phoneLabel = [UILabel new];
    phoneLabel.textColor = [UIColor colorWithHexString:@"#666666"];
    phoneLabel.font = KSystemFont(12);
    phoneLabel.attributedText = phoneStr;
    [self.view addSubview:phoneLabel];

    [phoneLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.bottom.equalTo(self.view).offset(-20);
        make.centerX.equalTo(self.view);
    }];
    
    UILabel * updateLabel = [[UILabel alloc] init];
    updateLabel.textColor = [UIColor colorWithHexString:@"#666666"];
    updateLabel.font = KSystemFont(12);
    updateLabel.text = @"版本更新";
    [self.view addSubview:updateLabel];
    
    [updateLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.bottom.equalTo(phoneLabel.mas_top).offset(-10);
        make.centerX.equalTo(self.view);
    }];
}



- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
}


@end
